package com.gopay.common.user.dao.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.user.PwdPrismCorp;
import com.gopay.common.user.dao.PwdPrismCorpDao;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;

/**
 * 个性化配置
 * @author <a href="mailto:yhwpeng@126.com">wangdong</a>
 * @date 2017-05-05 16:37:53
 */
@Repository("pwdPrismCorpDao")
public class PwdPrismCorpDaoImpl extends BaseDAOImpl<PwdPrismCorp,Serializable> implements PwdPrismCorpDao {

    /**
     * 根据设备信息获取
     * @author <a href="mailto:yhwpeng@126.com">wangdong</a>
     * @date 2017-05-05 16:57:32
     */
    @Override
    public PwdPrismCorp findByCustId(String custId) {
        DetachedCriteria criteria = DetachedCriteria.forClass(PwdPrismCorp.class);
        criteria.add(Restrictions.eq("custId", custId));

        List<PwdPrismCorp> list = this.findByCriteria(criteria);
        return list.size()>0 ?list.get(0):null;
    }
}
